﻿using Orchard.Environment.Extensions;
using Orchard.ContentManagement;

namespace FruitCake.SimpleGallery.Models {

    [OrchardFeature("FruitCake.SimpleGallery")]
    public class SimpleGalleryPart : ContentPart<SimpleGalleryPartRecord> {
        public string Path { get { return Record.Path; } set { Record.Path = value; } }

        public int FrameWidth { get { return Record.FrameWidth; } set { Record.FrameWidth = value; } }
        public int FrameHeight { get { return Record.FrameHeight; } set { Record.FrameHeight = value; } }
        public bool HasFrameSize { get { return Record.FrameHeight > 0 && Record.FrameWidth > 0; } }

        public int PageSize { get { return Record.PageSize; } set { Record.PageSize = value; } }
        public int PagerMaxItems { get { return Record.PagerMaxItems; } set { Record.PagerMaxItems = value; } }
        
        public bool EnableThumbnail { get { return Record.EnableThumbnail; } set { Record.EnableThumbnail = value; } }
        public TitleMode TitleMode { get { return Record.TitleMode; } set { Record.TitleMode = value; } }
        public string TitleSeparator { get { return Record.TitleSeparator; } set { Record.TitleSeparator = value; } }
        public LinkMode LinkMode { get { return Record.LinkMode; } set { Record.LinkMode = value; } }

        public bool HasTitleSeparator { get { return !string.IsNullOrWhiteSpace(TitleSeparator); } }
    }

}